import axios from '@/axios'
enum API {
    TASK_GETALL = '/getTaskAll',
    TASK_GETPAGE = '/getTaskPage',
    TASK_GETKEYPAGE = '/SearchTaskKey',
    TASK_UPDATEBYID = '/updataTaskById',
    TASK_DELETEBYID = '/deleteTaskById',
    TASK_DELETEMOREBYID = '/deleteTaskMoreById',
    TASK_ADD = '/addTask',
}
// 获取所有任务信息
export const getTaskAllAPI = () => axios.get(API.TASK_GETALL)
// 分页查询任务
export const getTaskPageAPI = (data: any) => axios.post(API.TASK_GETPAGE, data)
// 指定key-value分页查询任务
export const getTaskKeyPageAPI = (data: any) => axios.post(API.TASK_GETKEYPAGE, data)
// 根据id更新任务
export const UpdateTaskByIdAPI = (data: any) => axios.post(API.TASK_UPDATEBYID, data)
// 根据id删除任务
export const DeleteTaskByIdAPI = (id: string) => axios.delete(`${API.TASK_DELETEBYID}/${id}`)
// 根据id批量任务
export const DeleteTaskMoreByIdAPI = (ids: any) => axios.post(API.TASK_DELETEMOREBYID, ids)
// 添加任务
export const AddTaskAPI = (data: any) => axios.post(API.TASK_ADD, data)